# Contributor: Marvin Steadfast <marvin@xsteadfastx.org>
# Maintainer: Marvin Steadfast <marvin@xsteadfastx.org>
pkgname=rofi
pkgver=1.5.4
pkgrel=2
_libnkutils=8adccd3b1b33b2a9a29dd12a7e686907bbafc5d4
pkgdesc="A window switcher, application launcher and dmenu replacement"
url="https://github.com/DaveDavenport/rofi"
arch="all !s390x !mips !mips64" # Limited by librsvg
license="MIT"
makedepends="meson bison flex pangomm-dev pango-dev libxcb-dev xcb-util-dev
	xcb-util-wm-dev xcb-util-xrm-dev glib-dev cairo-dev libxkbcommon-dev
	librsvg-dev startup-notification-dev ronn"
checkdepends="cppcheck xkeyboard-config"
subpackages="$pkgname-dev $pkgname-doc"
source="https://github.com/davatorium/rofi/releases/download/$pkgver/rofi-$pkgver.tar.gz
	https://github.com/sardemff7/libnkutils/archive/$_libnkutils.tar.gz
	scrollbar-test.patch
	"

prepare() {
	default_prepare

	rm -rf subprojects/libnkutils
	mv "$srcdir"/libnkutils-$_libnkutils subprojects/libnkutils
}

build() {
	meson \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--buildtype=plain \
		. output
	ninja -C output
}

check() {
	ninja -C output test
}

package() {
	DESTDIR="$pkgdir" ninja -C output install
}

sha512sums="317c9c4930fea21cb72d8551cc6f8ebb66a1fb2477e361a95fd3e5823a3b6597fdf74e110d45b4e9c17712ecf4c5a16bbedd159ec03d83f4ec23b8390cf398f7  rofi-1.5.4.tar.gz
f527572eac0247f44ce16833cd5795f42e9a79b8f4e4f02df7c96fd1aac3db685ea95ff1048e4415ac4bbec0f5e37f5986efe1811b8991cab4d4f88518cbf0bd  8adccd3b1b33b2a9a29dd12a7e686907bbafc5d4.tar.gz
2edf85133c4ce1817a37ea480913725ff086bc570bcac7ea5100d7516dce816ba6471e530a1d979fbaf0d68ce2d4e4e7ddc9c32f238c2ac2db95fde98f62a44e  scrollbar-test.patch"
